// locations to search for config files that get merged into the main config;
// config files can be ConfigSlurper scripts, Java properties files, or classes
// in the classpath in ConfigSlurper format

// grails.config.locations = [ "classpath:${appName}-config.properties",
//                             "classpath:${appName}-config.groovy",
//                             "file:${userHome}/.grails/${appName}-config.properties",
//                             "file:${userHome}/.grails/${appName}-config.groovy"]

// if (System.properties["${appName}.config.location"]) {
//    grails.config.locations << "file:" + System.properties["${appName}.config.location"]
// }

grails.resources.debug=true 

grails.project.fork = [
        test   : false,
        run    : [maxMemory: 2048, minMemory: 512, debug: false, maxPerm: 256, forkReserve: false],
        war    : [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve: false],
        console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
]

grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination
grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
grails.mime.use.accept.header = false
grails.mime.types = [
        all          : '*/*',
        atom         : 'application/atom+xml',
        css          : 'text/css',
        csv          : 'text/csv',
        form         : 'application/x-www-form-urlencoded',
        html         : ['text/html', 'application/xhtml+xml'],
        js           : 'text/javascript',
        json         : ['application/json', 'text/json'],
        multipartForm: 'multipart/form-data',
        rss          : 'application/rss+xml',
        text         : 'text/plain',
        xml          : ['text/xml', 'application/xml']
]

// URL Mapping Cache Max Size, defaults to 5000
//grails.urlmapping.cache.maxsize = 1000

// What URL patterns should be processed by the resources plugin
grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*']

// The default codec used to encode data with ${}
grails.views.default.codec = "none" // none, html, base64
grails.views.gsp.encoding = "UTF-8"
grails.converters.encoding = "UTF-8"
// enable Sitemesh preprocessing of GSP pages
grails.views.gsp.sitemesh.preprocess = true
// scaffolding templates configuration
grails.scaffolding.templates.domainSuffix = 'Instance'

// Set to false to use the new Grails 1.2 JSONBuilder in the render method
grails.json.legacy.builder = false
// enabled native2ascii conversion of i18n properties files
grails.enable.native2ascii = true
// packages to include in Spring bean scanning
grails.spring.bean.packages = []
// whether to disable processing of multi part requests
grails.web.disable.multipart = false

// request parameters to mask when logging messages
grails.exceptionresolver.params.exclude = ['password']

// configure auto-caching of queries by default (if false you can cache individual queries with 'cache: true')
grails.hibernate.cache.queries = false

environments {
    development {
        grails.logging.jul.usebridge = true
        context = "web-app/"
        webinf = context + "WEB-INF/"
        images = context + "images/"
        benefPhotos = images + "benefPhotos/"
        productPhotos = images + "/productPhotos/"
        tracesPhoto = images + "tracesPhoto/"
        icons = images + "icons/"
        tsm {
/*
            server = "http://vgerndvud1098:7101/Tsm/"
            adminWsConnector = server + "mockAdminWsConnectorPortBinding"
            cAInfoCallBack = server + "mockCAInfoCallBackEndpointBinding"
            cardContentManagementCallBack = server + "mockCardContentManagementCallBackEndpointBinding"
            deviceApplicationBindingCallBack = server + "mockDeviceApplicationBindingCallBackEndpointBinding"
            deviceAplicationManagementCallBack = server + "mockDeviceApplicationManagementCallBackEndPointBinding"
            endUserInfo = server + "mockEndUserInfoEndPointBinding"
            extendedGlobalServiceManagement = server + "mockExtendedGlobalServiceManagementEndPointBinding"
            globalEligibilityInfo = server + "mockGlobalEligibilityInfoEndpointBinding"
            globalServiceManagement = server + "mockGlobalServiceManagementEndPointBinding"
            mobileSubscriptionLifeCycleNotification = server + "mockMobileSubscriptionLifeCycleNotificationEndPointBinding"
            scriptSendingCallBack = server + "mockScriptSendingEndPointBinding"
            sELifeCycleNotification = server + "mockSELifeCycleNotificationEndPointBinding"
            serviceLifeCycleNotification = server + "mockServiceLifeCycleNotificationEndPointBinding"
            */
            server = "http://vgerndvud1098:7101/Tsm/"
            adminWsConnector = server + "AdminWsConnectorService"
            cAInfoCallBack = server + "CAInfoCallBackService"
            cardContentManagementCallBack = server + "CardContentManagementCallBackService"
            deviceApplicationBindingCallBack = server + "DeviceApplicationBindingCallBack"
            deviceAplicationManagementCallBack = server + "DeviceAplicationManagementCallBackService"
            endUserInfo = server + "EndUserInfoService"
            extendedGlobalServiceManagement = server + "ExtendedGlobalServiceManagementService"
            globalEligibilityInfo = server + "GlobalEligibilityInfoService"
            globalServiceManagement = server + "GlobalServiceManagementService"
            mobileSubscriptionLifeCycleNotification = server + "MobileSubscriptionLifeCycleNotificationService"
            scriptSendingCallBack = server + "ScriptSendingCallBackService"
            sELifeCycleNotification = server + "SELifeCycleNotificationService"
            serviceLifeCycleNotification = server + "ServiceLifeCycleNotificationService"

        }
    }
    production {
        grails.logging.jul.usebridge = false
        context = "web-app/"
        webinf = context + "WEB-INF/"
        images = context + "images/"
        benefPhotos = images + "benefPhotos/"
        productPhotos = images + "productPhotos/"
        tracesPhoto = images + "tracesPhoto"
        icons = images + "icons/"
        tsm {
            server = "http://10.10.162.140:7101/Tsm/"
            adminWsConnector = server + "AdminWsConnectorService"
            cAInfoCallBack = server + "CAInfoCallBackService"
            cardContentManagementCallBack = server + "CardContentManagementCallBackService"
            deviceApplicationBindingCallBack = server + "DeviceApplicationBindingCallBack"
            deviceAplicationManagementCallBack = server + "DeviceAplicationManagementCallBackService"
            endUserInfo = server + "EndUserInfoService"
            extendedGlobalServiceManagement = server + "ExtendedGlobalServiceManagementService"
            globalEligibilityInfo = server + "GlobalEligibilityInfoService"
            globalServiceManagement = server + "GlobalServiceManagementService"
            mobileSubscriptionLifeCycleNotification = server + "MobileSubscriptionLifeCycleNotificationService"
            scriptSendingCallBack = server + "ScriptSendingCallBackService"
            sELifeCycleNotification = server + "SELifeCycleNotificationService"
            serviceLifeCycleNotification = server + "ServiceLifeCycleNotificationService"
        }
    }
}

log4j = {
    error 'grails.app'
    warn 'grails.app.domain', 'grails.app.controller', 'org.codehaus.groovy.grails.web.pages'
    //  Domain,controller and GSP
    warn 'org.apache.catalina'
}



grails.plugins.springsecurity.securityConfigType = "InterceptUrlMap"
grails.plugins.springsecurity.interceptUrlMap = [
        /*'/family/list*//**':['ROLE_ADMIN','ROLE_AGENT'] ,*/
        '/family/**'               : ['ROLE_ADMIN', 'ROLE_AGENT'],
        '/category/**'             : ['ROLE_ADMIN'],
        '/aid/**'                  : ['ROLE_ADMIN'],
        '/product/**'              : ['ROLE_ADMIN'],
        '/notification/**'         : ['ROLE_ADMIN'],
        '/user/**'                 : ['ROLE_ADMIN'],
        '/agent/**'                : ['ROLE_ADMIN'],
        '/admin/**'                : ['ROLE_ADMIN'],
        '/role/**'                 : ['ROLE_ADMIN'],
        '/userRole/**'             : ['ROLE_ADMIN'],
        '/level/**'                : ['ROLE_ADMIN'],
        '/locality/create/**'      : ['ROLE_ADMIN'],
        '/fairPricesShop/create/**': ['ROLE_ADMIN'],
        '/fairPricesShop/list'     : ['ROLE_ADMIN', 'ROLE_AGENT'],
        /*'/webService*//**'   :  ['ROLE_ADMIN','ROLE_AGENT'],*/
        '/webServiceAgent/**'      : ['permitAll'],
        '/webservice/**'           : ['permitAll']
        /*
        '/webServiceAgent/family'    : ['ROLE_AGENT'],
        '/webServiceAgent/product'   : ['ROLE_AGENT'],
        '/webServiceAgent/aid'       : ['ROLE_AGENT'],
        '/webServiceAgent/categories': ['ROLE_AGENT'],
        '/webServiceAgent/families'  : ['ROLE_AGENT'],
        '/webServiceAgent/aids'      : ['ROLE_AGENT'],
        '/webServiceAgent/products'  : ['ROLE_AGENT']
        */
]

fileuploader {
    avatar {
        maxSize = 1024 * 256 //256 kbytes
        allowedExtensions = ["jpg", "jpeg", "gif", "png"]
        path = "/tmp/avatar/"
    }
    docs {
        maxSize = 1000 * 1024 * 4 //4 mbytes
        allowedExtensions = ["doc", "docx", "pdf", "rtf", "csv", "xml", "xls"]
        path = "/tmp/docs/"
    }
}

// Uncomment and edit the following lines to start using Grails encoding & escaping improvements

/* remove this line 
// GSP settings
grails {
    views {
        gsp {
            encoding = 'UTF-8'
            htmlcodec = 'xml' // use xml escaping instead of HTML4 escaping
            codecs {
                expression = 'html' // escapes values inside null
                scriptlet = 'none' // escapes output from scriptlets in GSPs
                taglib = 'none' // escapes output from taglibs
                staticparts = 'none' // escapes output from static template parts
            }
        }
        // escapes all not-encoded output at final stage of outputting
        filteringCodecForContentType {
            //'text/html' = 'html'
        }
    }
}
remove this line */

// Added by the Spring Security Core plugin:
grails.plugins.springsecurity.userLookup.userDomainClassName = 'first.endtoend.User'
grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'first.endtoend.UserRole'
grails.plugins.springsecurity.authority.className = 'first.endtoend.Role'
grails.plugins.springsecurity.controllerAnnotations.staticRules = [
        '/'                  : ['permitAll'],
        '/**'                : ['permitAll'],
//	'/dashBoard/**':                     ['permitAll'],
        '/login/**'          : ['permitAll'],
        '/index'             : ['permitAll'],
        '/index.gsp'         : ['permitAll'],
        '/**/js/**'          : ['permitAll'],
        '/**/css/**'         : ['permitAll'],
        '/**/images/**'      : ['permitAll'],
        '/**/favicon.ico'    : ['permitAll'],
        '/webServiceAgent/**': ['permitAll'],
        '/webservice/**'     : ['permitAll']
        // /*'/family/list*//**':['ROLE_ADMIN','ROLE_AGENT'] ,*/
        // '/family/**' :['ROLE_ADMIN'] ,
        // '/category/**': ['ROLE_ADMIN'],
        // '/aid/**' : ['ROLE_ADMIN'] ,
        // '/product/**':['ROLE_ADMIN'],

        // '/user/**'       : ['ROLE_ADMIN'],
        // '/agent/**'       : ['ROLE_ADMIN'],
        // '/admin/**' :    ['ROLE_ADMIN'],
        // '/role/**'       : ['ROLE_ADMIN'],
        // '/userRole/**'   : ['ROLE_ADMIN'] ,
        // '/level/**' : ['ROLE_ADMIN'],
        // '/locality/create/**': ['ROLE_ADMIN'] ,
        // '/fairPricesShop/create/**': ['ROLE_ADMIN'],
        // '/fairPricesShop/list':['ROLE_ADMIN','ROLE_AGENT'],
        // /*'/webService*//**'   :  ['ROLE_ADMIN','ROLE_AGENT'],*/

        // /* '/webServiceAgent/family':['ROLE_AGENT'],
        // '/webServiceAgent/product':['ROLE_AGENT'],
        // '/webServiceAgent/aid':['ROLE_AGENT']  ,*/
        // '/webServiceAgent/categories':['ROLE_AGENT'],
        // '/webServiceAgent/families':['ROLE_AGENT'],
        // '/webServiceAgent/aids':['ROLE_AGENT'],
        // '/webServiceAgent/products':['ROLE_AGENT']
]

////Added by the Spring Security Core plugin:
// grails.plugin.springsecurity.userLookup.userDomainClassName = 'first.endtoend.SecUser'
// grails.plugin.springsecurity.userLookup.authorityJoinClassName = 'first.endtoend.SecUserSecRole'
// grails.plugin.springsecurity.authority.className = 'first.endtoend.SecRole'
// grails.plugin.springsecurity.controllerAnnotations.staticRules = [
// '/':                              ['permitAll'],
// '/**':                              ['permitAll'],
// '/dashBoard/**':                     ['permitAll'],
// '/index':                         ['permitAll'],
// '/login/**':                      ['permitAll'],
// '/index.gsp':                     ['permitAll'],
// '/**/js/**':                      ['permitAll'],
// '/**/css/**':                     ['permitAll'],
// '/**/images/**':                  ['permitAll'],
// '/**/favicon.ico':                ['permitAll'],
// /*'/family/list*//**':['ROLE_ADMIN','ROLE_AGENT'] ,*/
// '/family/**' :['ROLE_ADMIN'] ,
// '/category/**': ['ROLE_ADMIN'],
// '/aid/**' : ['ROLE_ADMIN'] ,
// '/product/**':['ROLE_ADMIN'],

// '/user/**'       : ['ROLE_ADMIN'],
// '/agent/**'       : ['ROLE_ADMIN'],
// '/admin/**' :    ['ROLE_ADMIN'],
// '/role/**'       : ['ROLE_ADMIN'],
// '/userRole/**'   : ['ROLE_ADMIN'] ,
// '/level/**' : ['ROLE_ADMIN'],
// '/locality/create/**': ['ROLE_ADMIN'] ,
// '/fairPricesShop/create/**': ['ROLE_ADMIN'],
// '/fairPricesShop/list':['ROLE_ADMIN','ROLE_AGENT'],
// '/webServiceAgent/categories':['ROLE_AGENT'],
// '/webServiceAgent/families':['ROLE_AGENT'],
// '/webServiceAgent/aids':['ROLE_AGENT'],
// '/webServiceAgent/products':['ROLE_AGENT']

// ]


grails.war.dependencies
grails.war.java5.dependencies
/**
 * Fix grails taglib <g:paginate/> to work with bootstrap css.
 */
grails.plugins.twitterbootstrap.fixtaglib = true

/**
 * Android  Google Cloud Messaging ( GCM ) config
 *
 */
android.gcm.api.key = "AIzaSyC-vg2z5GvFTU3O9Z4XpEDtT_6ymbDWDRA" //The GCM service API key. Must be passed as a method parameter if is not provided in the config
android.gcm.time.to.live = 2419200 // The message TTL (2419200 by default)
android.gcm.delay.'while'.idle = "Delay GCM"// Should the message be delayed with the device is idle (false by default)
android.gcm.retries = 1 // Number of message sent retries (1 by default)

cxf {
    servlet {

        /**
         * cxf.servlet.loadOnStartup
         * <p>
         * Specifies the order in which to load the servlet. Lower positive
         * values load first, while negative or unspecified mean that the
         * sevlet can be loaded at anytime.
         */
        loadOnStartup = 10

        /**
         * cxf.servlet.defaultServlet
         * <p>
         * When multiple servlets are defined by the {@code cxf.servlets}
         * configuration value this specifies the default binding for endpoints
         * that don't explicitly define a {@code static servlet = name}. If
         * this value is not set then the first alphabetically will be used.
         */
        //defaultServlet = 'CxfServlet'
    }

    /**
     * cxf.servlets
     * <p>
     * A map of Servlet Name -> Servlet Mapping Pattern. If multiple Cxf
     * servlets are required or a different mapping pattern is needed this
     * configuration allows that.
     */
    servlets = [
            CxfServlet: '/services/*'
    ]

    endpoint {

        /**
         * cxf.endpoint.soap12Binding
         * <p>
         * Sets the Cxf Server Factory to generate a Soap 1.2 binding. This can
         * also be set on a per endpoint basis using
         * {@code static soap12 = true}.
         */
        soap12Binding = false
    }
}
